package net.borlis.server;

import net.borlis.server.outer.NodeManager;
import net.borlis.server.outer.OuterServer;
import net.borlis.server.properties.GeneralProperties;
import net.borlis.server.properties.JdbcProperties;
import net.borlis.server.properties.MongoProperties;
import net.borlis.server.properties.ServerProperties;
import org.apache.catalina.startup.Tomcat;

/**
 * Created by borlis on 26.12.2014.
 */
public class Main {

    private static GeneralProperties generalProperties = new GeneralProperties();
    private static JdbcProperties jdbcProperties = new JdbcProperties();
    private static ServerProperties serverProperties = new ServerProperties();
    private static MongoProperties mongoProperties;
    private static NodeManager nodeManager;

    public static void main(String[] args) {
        nodeManager = new NodeManager(jdbcProperties, serverProperties, generalProperties);
        try {
            nodeManager.register();
            OuterServer server = OuterServer.getInstance();
            Tomcat tomcat = server.getServer(serverProperties);
            server.start();
            while (true) {
                System.out.println("");
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    private String identifyMyAddress(String port) {
        return null;
    }

}
